package com.turing.post.thirdinterface.util;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * 卡交易明细对照表
 * 
 * @author zxp
 * @Jan 27, 2013
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "MapPMBSTradDetail")
@IdClass(MapPMBSTradDetail.class)
public class MapPMBSTradDetail implements Serializable {

	/**
	 * Default constructor.
	 */
	public MapPMBSTradDetail() {
		super();
	}

	/**
	 * 商户号
	 */
	@Id
	@Column(name = "MerchantNo", nullable = false)
	private String MerchantNo;

	public String getMerchantNo() {
		return MerchantNo;
	}

	public void setMerchantNo(String merchantNo) {
		MerchantNo = merchantNo;
	}

	@Id
	@Column(name = "trandate", nullable = false)
	private String trandate;

	public String getTrandate() {
		return trandate;
	}

	public void setTrandate(String trandate) {
		this.trandate = trandate;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((this.getMerchantNo() == null) ? 0 : this.getMerchantNo().hashCode());
		result = prime * result
				+ ((this.getTrandate() == null) ? 0 : this.getTrandate().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final MapPMBSTradDetail other = (MapPMBSTradDetail) obj;
		if (getMerchantNo() == null) {
			if (other.getMerchantNo() != null)
				return false;
		} else if (!getMerchantNo().equals(other.getMerchantNo()))
			return false;
		if (getTrandate() == null) {
			if (other.getTrandate() != null)
				return false;
		} else if (!getTrandate().equals(other.getTrandate()))
			return false;
		return true;
	}

}
